#!/bin/sh

SOURCE="$0"
while [ -h "$SOURCE"  ]; do # resolve $SOURCE until the file is no longer a symlink
    scriptDir="$( cd -P "$( dirname "$SOURCE"  )" && pwd  )"
    SOURCE="$(readlink "$SOURCE")"
    [[ $SOURCE != /*  ]] && SOURCE="$scriptDir/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the directoryId where the symlink file was located
done
scriptDir="$( cd -P "$( dirname "$SOURCE"  )" && pwd  )"
basedir=${scriptDir%/*}
echo $basedir

cd $basedir
echo start clean and package=================
mvn clean package  -Dmaven.test.skip=true
#echo Copying $basedir/api/target/api-0.0.1-SNAPSHOT.jar to $HOME/pro/crawler-api.jar
#cp $basedir/api/target/api-0.0.1-SNAPSHOT.jar $HOME/pro/crawler-api.jar